package org.protester.core;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;

import org.protester.base.EntityBase;

@Entity
public class Category extends EntityBase {

	@Column(nullable = false, unique = true)
	private String name;
	@Column(nullable = false)
	private String description;
	@OneToOne(cascade = CascadeType.PERSIST)
	private Category parent;

	public Category() {
	}

	public Category(String name, String description) {
		this.name = name;
		this.description = description;
	}

	public Category(String name, String description, Category parent) {
		this.name = name;
		this.description = description;
		this.parent = parent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Category getParent() {
		return parent;
	}

	public void setParent(Category parent) {
		this.parent = parent;
	}

}
